import { Layout, Typography, Space } from 'antd';
import { history } from 'umi';

const { Text, Link } = Typography;

const Index = () => {
  const exit = () => {
    history.push('/login');
    localStorage.clear();
  };
  return (
    <Layout.Header
      className="site-layout-background"
      style={{
        padding: '0 20px',
        textAlign: 'right',
        borderBottom: '1px solid #096dd9',
      }}
    >
      <Space>
        <Text>欢迎你, xxx</Text>
        <Link onClick={exit}>退出</Link>
      </Space>
    </Layout.Header>
  );
};

export default Index;
